import multiprocessing
import os
import sys
import time

import pyautogui
import serial
import win32gui
from pygame import mixer
from neuracle_lib.triggerBox import TriggerBox,TriggerIn,PackageSensorPara
import serial.tools.list_ports
from pathlib import Path


def cue_tone_open_eyes():

    mixer.init()
    mixer.music.load(str(Path(__file__).resolve().parent.parent)+'/static/music/open_eyes.mp3')
    mixer.music.play()

def cue_tone_close_eyes():
    mixer.init()
    mixer.music.load(str(Path(__file__).resolve().parent.parent)+'/static/music/close_eyes.mp3')
    mixer.music.play()

def cue_tone_end():
    mixer.init()
    mixer.music.load(str(Path(__file__).resolve().parent.parent)+'/static/music/end.mp3')
    mixer.music.play()



def trigger_test():
    ports = []
    for port in serial.tools.list_ports.comports():
        ports.append(port.name)
    print(ports)

    # triggerbox = TriggerBox("COM3")
    # triggerbox.output_event_data(0)


if __name__ == '__main__':
    trigger_test()

